package com.zonda.sampleretrofit2.view;


import android.content.res.Resources;

import com.zonda.sampleretrofit2.R;

public class NewsListItemHelper {

  public static final float SMALL_IMAGE_RATIO = 159 / 113f;

  public static int calculateSmallImageWidth(int availableWidth, Resources resources) {

    final int maxImageNum = 3;
    int horizontalSpacing = resources.getDimensionPixelSize(R.dimen.image_padding);
    return (availableWidth - horizontalSpacing * (maxImageNum - 1)) / maxImageNum;
  }
}
